/**
 * 
 * 广州锐鹏计算机科技有限公司（www.ruipengkj.com）
 * 
 * 
 * Copyright (c) 2011-2012 RUIPENGKJ.Co.Ltd. All rights reserved.
 * 
 * */
package com.ruipengkj.view.statementView;
/**
 * 说明：
 * 盘点盈余单汇总表控制界面
 * @Author：
 * @Date：2012-03-21
 */
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.GridLayout;

import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;

import com.ruipengkj.bean.TEmployee;
import com.ruipengkj.commons.base.query.PageView;
import com.ruipengkj.component.DataPackageComponent;
import com.ruipengkj.component.JLabelJTextFieldComponent;
import com.ruipengkj.component.RPJButtonGray;
import com.ruipengkj.component.RPJButtonPrint;
import com.ruipengkj.component.page.PageDelegale;
import com.ruipengkj.component.page.PagingComponent;

public class StatementInventorySurplus implements PageDelegale ,Runnable{
	private DataPackageComponent startTime;//开始日期
	private DataPackageComponent endTime; //结束日期
	private JLabelJTextFieldComponent storeName; //仓库名称
	
	private JButton selectButton;//选择
	private JButton clearButton;//清除按钮
	private JButton printButton; //打印
	private JButton exportButton; //导出
	private JButton exitButton; //退出
	
	private JTable inventorySurplusTable;//盘点盈余单汇总表TABLE
	private JScrollPane inventorySurplusJsp;//盘点盈余单汇总表JScrollPane
	
	private PagingComponent pagingComponent;//翻页组件
	private PageView<TEmployee> pageView;//翻页主键
	
	public StatementInventorySurplus() {
		init();
	}
	
	private void init() {
		DefaultTableModel inventorySurplusModel = new DefaultTableModel(new String[][]{}, new String[]{
				"编号", "发生日期", "入库单号", "数量合计", "总价合计"
		});
		
		startTime = new DataPackageComponent("开始日期", 15);
		endTime = new DataPackageComponent("结束日期", 15);
		storeName = new JLabelJTextFieldComponent("仓库名称", 15);
		selectButton = new JButton("选择");
		clearButton=new RPJButtonGray("清空");
		
		inventorySurplusTable = new JTable(inventorySurplusModel);
		inventorySurplusJsp = new JScrollPane(inventorySurplusTable);
		
		printButton = new JButton("打印");
		exportButton = new RPJButtonPrint("导 出");
		exitButton = new JButton("退出");
		
		pagingComponent=new PagingComponent();
		pagingComponent.setPageDelegale(this);
	}
	
	public JPanel getRightPanel() {
		JPanel right_panel = new JPanel(new GridLayout(2, 1));
		JPanel jp2 = new JPanel(new BorderLayout());
		
		JPanel jp1 = new JPanel(new FlowLayout(FlowLayout.LEFT));
		jp1.add(startTime);
		jp1.add(endTime);
		jp1.add(storeName);
		jp1.add(selectButton);
		jp1.add(clearButton);
		
		jp2.add(jp1, BorderLayout.NORTH);
		jp2.add(inventorySurplusJsp, BorderLayout.CENTER);
		right_panel.add(jp2);
		return right_panel;
	}
	
	public JPanel getTailPanel() {
		JPanel tail_panel = new JPanel(new GridLayout(2, 1));
		
		JPanel jp2 = new JPanel(new FlowLayout(FlowLayout.RIGHT));
		jp2.add(printButton);
		jp2.add(exportButton);
		jp2.add(exitButton);
		
		tail_panel.add(pagingComponent);
		tail_panel.add(jp2);
		return tail_panel;
	}

	@Override
	public String getInfo() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void homePage() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void lastPage() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void nextPage() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void prevPage() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void run() {
		// TODO Auto-generated method stub
		
	}
}
